/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-04-26
 * Time: 15:23
 */
class Animal <T> {
    T[] array = (T[])new Object[10];

    public T getArray(int pos) {
        return array[pos];
    }

    public void setArray(int pos ,T s) {
        array[pos] = s;
    }
}

public class TestDemo {
    public static void main(String[] args) {
        Integer[] array ={1,2,3,4,5,6,7};

    }
    public static void main1(String[] args) {
        Animal<Integer> animal = new Animal<Integer>();
        animal.setArray(0,20);
        animal.setArray(1,30);
        System.out.println(animal.getArray(0));

        Animal<String> animal1 = new Animal<String>();
        animal1.setArray(0,"温习文");
        animal1.setArray(1,"温鹏");
        System.out.println(animal1.getArray(1));
    }
}